<?php

function HHO_APP_CONFIG() {
	$config = array();
	
	if ($_SERVER['SERVER_ADDR'] == '127.0.0.1') { // 开发环境
		$config['session'] = FALSE;
		$config['data.root'] = HHO_APP_PATH . '/Data';
		$config['dsn'] = array('ticket' => array('mysql:host=127.0.0.1;port=3306;dbname=ticket;', 'root', 'root', 'utf8'));
		$config['debug'] = TRUE;
		$config['error.log'] = 2;
		$config['404.html'] = Core\HHO::$config['view.root'] . '/' . Core\HHO::$config['view.default'] . '/404.php';
	} elseif ($_SERVER['SERVER_ADDR'] == '192.168.1.20') { // ThinkPad 生产环境
		$config['session'] = FALSE;
		$config['data.root'] = HHO_APP_PATH . '/Data';
		$config['dsn'] = array('ticket' => array('mysql:host=192.168.1.80;port=3306;dbname=ticket;', 'root', 'root', 'utf8'));
		$config['debug'] = FALSE;
		$config['error.log'] = 2;
		$config['404.html'] = Core\HHO::$config['view.root'] . '/' . Core\HHO::$config['view.default'] . '/404.php';
	} else { // 生产环境
		$config['session'] = FALSE;
		$config['data.root'] = HHO_APP_PATH . '/Data';
		$config['dsn'] = array('ticket' => array('mysql:host=192.168.1.100;port=3306;dbname=ticket;', 'root', 'root', 'utf8'));
		$config['debug'] = FALSE;
		$config['error.log'] = 2;
		$config['404.html'] = Core\HHO::$config['view.root'] . '/' . Core\HHO::$config['view.default'] . '/404.php';
	}
	
	return $config;
}